import React, { PureComponent } from "react"
import { createPortal } from "react-dom"
import LoadingStyle from "./loading.style"
// Portal一般用来写弹窗
// 渲染函数
const fn = function (props) {
  return (
    <div
      style={{
        position: "absolute",
        bottom: "0",
        left: "0",
        textAlign: "center"
      }}
    >
      <LoadingStyle />
    </div>
  )
}

export default class Portal extends PureComponent {
  constructor(props) {
    super(props)
  }

  render() {
    const props = this.props
    return createPortal(fn(props), document.getElementById("react-model"))
  }
}
